-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fields required in all groups and nodes requests #1515
Conversation
@@ -11,5 +11,5 @@ export function getRequiredDataFields<ColumnId extends string, RequiredField ext | |||
return fields; | |||
}, new Set<RequiredField>()); | |||
|
|||
return Array.from(requiredFieldsSet); | |||
return Array.from(requiredFieldsSet).sort(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort to ensure no additional requests when order changes.
Example:
Columns [DiskSpace, Read]
, data fields [State, Read]
Columns [Read, State]
, data fields [Read, State]
Although it's the same data, it will be requested twice, because of different state keys ("fieldsRequired:State,Read"
vs "fieldsRequired:Read,State"
@@ -40,7 +40,9 @@ export function StorageGroupPage() { | |||
const shouldUseGroupsHandler = useStorageGroupsHandlerAvailable(); | |||
const capabilitiesLoaded = useCapabilitiesLoaded(); | |||
const groupQuery = storageApi.useGetStorageGroupsInfoQuery( | |||
valueIsDefined(groupId) ? {groupId, shouldUseGroupsHandler, with: 'all'} : skipToken, | |||
valueIsDefined(groupId) | |||
? {groupId, shouldUseGroupsHandler, with: 'all', fieldsRequired: 'all'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only 1 group is requested here and we need all its data
@@ -107,6 +107,7 @@ export const Storage = ({database, viewContext, nodeId, groupId, pDiskId}: Stora | |||
groupId, | |||
pDiskId, | |||
shouldUseGroupsHandler: groupsHandlerAvailable, | |||
fieldsRequired: 'all', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible to request data based on columns for not paginated storage. However, there is a problem: when you update columns, needed data fields are updated and data reloaded. For paginated table it isn't the issue, because it loads only 50 entities, but for not paginated tables requests take to long to load, so we need to avoid data reloads if possible.
I expect, that soon enough we will fix all issues with PaginatedTable
and could get rid of DataTable
in Storage
Closes #1485
CI Results
Test Status:⚠️ FLAKY
📊 Full Report
Bundle Size: ✅
Current: 79.04 MB | Main: 79.03 MB
Diff: +0.00 MB (0.00%)
✅ Bundle size unchanged.
ℹ️ CI Information